package ru.isys.yoomee.util.timemap;

import ru.isys.yoomee.R;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Point;
import android.location.Location;
import android.location.LocationManager;

import com.google.android.maps.GeoPoint;
import com.google.android.maps.MapView;
import com.google.android.maps.MyLocationOverlay;

public class TimemapMyLocationOverlay extends MyLocationOverlay
{
    private Context mContext;
    private LocationManager mLocManager;

    public TimemapMyLocationOverlay(Context context, MapView mapView)
    {
        super(context, mapView);
        mContext = context;
    }

    @Override
    protected void drawMyLocation(Canvas canvas, MapView mapView, Location lastFix, GeoPoint myLocation, long when)
    {
        // translate the GeoPoint to screen pixels
        Point screenPts = mapView.getProjection().toPixels(myLocation, null);
        Bitmap arrowBitmap = BitmapFactory.decodeResource(mContext.getResources(), R.drawable.timemap_yoo_location);
        canvas.drawBitmap(arrowBitmap, screenPts.x - (arrowBitmap.getWidth() / 2), screenPts.y - (arrowBitmap.getHeight()), null);
    }  
    
    
}
